home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1096 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.9 KB

  1. Path: news-ath.forthnet.gr!usenet
  2. From: thimm@onned.gr (Herbert Thimm)
  3. Newsgroups: comp.lang.c++,comp.lnag.c++.moderated
  4. Subject: Re: cached output in c++
  5. Date: Tue, 09 Jan 1996 02:40:22 GMT
  6. Organization: Foundation for Research and Technology Hellas, FORTHnet
  7. Message-ID: <4cskd9$duv@brigitte.forthnet.gr>
  8. References: <4boulr$qiu@brigitte.forthnet.gr> <4chcgk$ldg@gold.datalytics.com>
  9. Reply-To: thimm@onned.gr
  10. NNTP-Posting-Host: dialup2.onned.gr
  11. X-Newsreader: Forte Free Agent 1.0.82
  12.  
  13. Rob Stewart <stew@datalytics.com> wrote:
  14.  
  15. >thimm@onned.gr (Herbert Thimm) wrote:
  16. >>Hello,
  17. >>I am wondering, if C++ has build in buffered output (and input).
  18.  
  19. >Indeed, the iostreams library of classes do caching.  When you 
  20. >construct them, you can specify a streambuf-derived object 
  21. >to use for the buffer.  streambuf-derived classes permit 
  22. >you to provide the buffer they should use, so you can allocate 
  23. >whatever size buffer you need.
  24.  
  25. >Do note, however, that--at least in the implementations I've 
  26. >seen--streambuf doesn't split the buffer between input and 
  27. >output buffering.  Instead, it uses the one buffer one way or 
  28. >the other.  To get optimal buffering, you'd need to have an 
  29. >istream-derived object and an ostream-derived object 
  30. >separately operating on the same stream.  However, you'd also 
  31. >have to synchronize them such that changes made by the ostream 
  32. >invalidate the affected parts of the istream buffer.
  33.  
  34. Hello Rob and thanks for your answer,
  35. I only need iostreams to work either as istreams or as ostreams, so
  36. the usage of a common buffer does not seem to be a problem to me.
  37. Do you know how to set the buffersizes? I am working with g++ 2.6.3 and
  38. the documentation is not helping very much. (It says the details are
  39. beeing worked out). Is there a way to set the cache size w/o getting
  40. compiler/library dependend (that is, is the ANSI standard saying how to
  41. do it?)
  42.  
  43. >-- 
  44. >Robert Stewart        | My opinions are usually my own.
  45. >Datalytics, Inc.
  46. >(513)226-7700
  47. >stew@datalytics.com
  48.  
  49.  
  50.